package com.blog.zip.config;

import com.blog.zip.interceptor.AuthenticationInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class AdminWebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new AuthenticationInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns(
                        "/web/**", "/", "/user/login", "/css/**", "/font/**", "/images/**", "/js/**", "/article/get",
                        "/article/getById","/category/get","/tag/article/get","/tags/get","/blog/info/get","/article/draw/get","/article/getByPath"
                        ,"/admin/cross/get","/link/get","/indexData/get","/article/recordViewCount"
                );
    }
}
